//
//  VideoCollectionViewCell.m
//  OneDay
//
//  Created by lanou3g on 15/10/27.
//  Copyright © 2015年 oneDay. All rights reserved.
//

#import "VideoCollectionViewCell.h"

@implementation VideoCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        CGFloat kw = frame.size.width;
        self.backgroundImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kw, kHeight / 3.4)];
        self.backgroundImageView.layer.cornerRadius = self.backgroundImageView.frame.size.height / 25;
        self.backgroundImageView.layer.masksToBounds = YES;
        [self addSubview:self.backgroundImageView];
        
        self.signLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.55 * kw, self.backgroundImageView.height * 0.2, 0.35 * kw, 30)];
        self.signLabel.textColor = [UIColor blackColor];
        self.signLabel.alpha = 0.5;
        self.signLabel.backgroundColor = [UIColor grayColor];
        [self.backgroundImageView addSubview:self.signLabel];
    }
    return self;
}

- (void)setModel:(CategoryModel *)model
{
    if (_model != model) {
        _model = model;
    }
    [self.backgroundImageView sd_setImageWithURL:[NSURL URLWithString:self.model.bgPicture] placeholderImage:[UIImage imageNamed:@"oneDay.jpg"]];
    self.signLabel.text = [NSString stringWithFormat:@"#%@", self.model.name];
}

@end
